import { SelectControlSchema } from 'amis/lib/renderers/Form/Select'
import amisUtils from '@/components/amis/amisUtils'
import IamAccountProfileSexEnum from '@/core/account/generated/enums/IamAccountProfileSexEnum'
import IamAccountProfileRegisterSourceFromEnum from '@/core/account/generated/enums/IamAccountProfileRegisterSourceFromEnum'

class IamAccountProfileRegisterSourceFromSelectUtils {
	getSchema = (parmas?: Partial<SelectControlSchema>): SelectControlSchema => {
		const mergeSchema = Object.assign(
			{
				name: 'registerSourceFrom',
				type: 'select',
				label: '注册来源',
				clearable: true,
				options: amisUtils.getSelectOptionsFromBaseEnum(IamAccountProfileRegisterSourceFromEnum),
			},
			parmas,
		)

		const schema = mergeSchema
		return schema
	}
}

export default new IamAccountProfileRegisterSourceFromSelectUtils()
